package org.project.service.mq1;

import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
import javax.jms.TextMessage;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

import com.ibm.mq.jms.MQQueue;

@Component("textMessageListener")
public class TextMessageListener implements MessageListener {
	
	@Autowired
	public void onMessage(Message message) {
		try {
			TextMessage msg = (TextMessage) message;
			String msgStr = msg.getText();
			System.out.println("Receive message:" + msgStr);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
